<?php

include_once("functions/db_manipulate.php");
if (!init()) {
    redirect('login.php');
}

$link_id = connectDB();
startTransaction();

$resultSet = mysql_query("INSERT INTO flyspam(flycommentid, userid)
                          VALUES ('" . mysql_real_escape_string($_GET['fid']) . "',
                                  '" . $_SESSION['id'] . "')") or die(mysql_error());

if ($resultSet) {
    commitTransaction();
} else {
    rollbackTransaction();
}

redirect($_SERVER['HTTP_REFERER']);
